package cn.xiaobai.config;

import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * 日志生成配置
 *
 * @Author yangdaji
 * @Date 2024/5/4
 * @PackageName cn.xiaobai.config
 * @ClassName HolidayProperties
 */
@Data
@ConfigurationProperties(prefix = "work")
public class HolidayProperties {

    /**
     * 自定义工作目录
     */
    private String path;

    /**
     * 文件匹配深度, 默认4层
     */
    private Integer maxdepth = 4;

    /**
     * 节假日json 文件名称
     */
    private String holidayPath;

    /**
     * 日志欢迎词
     */
    private String welcomeName;

    /**
     * 是否大小周
     */
    private Boolean weekSize = false;


    /**
     * 默认工作目录
     */
    private final String DEFAULT_WORK_PATH = "C:/Users/Administrator/Desktop/work/";

    public void setWelcomeName(String welcomeName) {
        if (StringUtils.length(welcomeName) >= 100) {
            this.welcomeName = "1.";
        } else {
            this.welcomeName = welcomeName;
        }
    }
}
